package org.restlet.ext.softmed;

import java.io.IOException;
import java.io.OutputStream;

import org.restlet.data.MediaType;
import org.restlet.resource.OutputRepresentation;

public class ByteArrayRepresentation extends OutputRepresentation {

	byte[] bytes;

	public ByteArrayRepresentation(byte[] bytes, MediaType mtype) {
		super(mtype);
		this.bytes = bytes;
	}

	@Override
	public void write(OutputStream stream) throws IOException {
		stream.write(bytes);
		stream.flush();
		stream.close();
	}

};
